package entities;

public class TreeAssociation {
	private Long id;
	private String parentCode;
	private String childCode;
	private String parentType;
	private String childType;
	private int childOrder;
	
	
	public TreeAssociation() {
		
	}
	
	
	public TreeAssociation(String parentCode, String childCode,
			String parentType, String childType, int childOrder) {
		super();
		this.parentCode = parentCode;
		this.childCode = childCode;
		this.parentType = parentType;
		this.childType = childType;
		this.childOrder = childOrder;
	}



	public Long getId() {
		return id;
	}
	
	public void setId(Long id) {
		this.id = id;
	}

	public String getParentCode() {
		return parentCode;
	}

	public void setParentCode(String parentCode) {
		this.parentCode = parentCode;
	}

	public String getChildCode() {
		return childCode;
	}

	public void setChildCode(String childCode) {
		this.childCode = childCode;
	}

	public String getParentType() {
		return parentType;
	}

	public void setParentType(String parentType) {
		this.parentType = parentType;
	}

	public String getChildType() {
		return childType;
	}

	public void setChildType(String childType) {
		this.childType = childType;
	}

	public int getChildOrder() {
		return childOrder;
	}

	public void setChildOrder(int childOrder) {
		this.childOrder = childOrder;
	}


	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((childCode == null) ? 0 : childCode.hashCode());
		result = prime * result
				+ ((parentCode == null) ? 0 : parentCode.hashCode());
		return result;
	}


	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TreeAssociation other = (TreeAssociation) obj;
		if (childCode == null) {
			if (other.childCode != null)
				return false;
		} else if (!childCode.equals(other.childCode))
			return false;
		if (parentCode == null) {
			if (other.parentCode != null)
				return false;
		} else if (!parentCode.equals(other.parentCode))
			return false;
		return true;
	}


}
